// ==================================================================================
// Shared Genomics Project MPI Codebase
// Version 1.0 30/04/2010
//
// (c) 2010 University of Manchester all rights reserved
//
// This file is distributed under the GNU General Public License, Version 2.  
// Please see the file COPYING.txt for more details
// ==================================================================================

#ifndef _PPAIR_H_
#define _PPAIR_H_

#include "types.h"

#ifdef __cplusplus
extern "C" {
#endif

/*!
\file
\ingroup	gio
\brief		Test statistic/P-value Array Pair
*/

/*! \brief Test statistic, Array Index %Pair */
struct ppair {
	/*! \brief Test Statistic */
	double p;

	/*! \brief Array Index */
	int l;
};

/*!
\brief Create a \ref ppair array.
\param [in] n Array size
\returns \ref ppair array or NULL on failure.
*/
struct ppair* ppair_create_array(int n);

/*!
\brief QSort comparator for \ref ppair.
\param [in] p1 ppair paramter one
\param [in] p2 ppair paramter two
\returns -1 if less, 0 if equal, 1 if greater
*/
int ppair_cmp(const void* p1, const void* p2);

/*! \brief Echo a %ppair struct to STDOUT. */
void ppair_echo(struct ppair* pp);

#ifdef __cplusplus
}
#endif

#endif // _ADJUSTED_H_
